package org.example.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author TonySong
 * @date 2025/7/29 0029
 * @time 9:44
 */
public class DateUtil {

    private static final String DATE_FORMAT = "yyyy年MM月dd日 HH:mm:ss";
    private static final SimpleDateFormat SDF= new SimpleDateFormat("HH:mm");
    public static String getDateFormat(Date date) {
        return new SimpleDateFormat(DATE_FORMAT).format(date);
    }
    public static Date getDateByString(String str) throws ParseException {
        return SDF.parse(str);
    }

    public static String showDate(Date date){
        return new SimpleDateFormat(DATE_FORMAT).format(date);
    }


    public static String createTime(){
        return new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
    }
}
